//
//  MineViewController.m
//  pocketNews
//
//  Created by DS on 2018/10/26.
//  Copyright © 2018年 徐双. All rights reserved.
//

#import "MineViewController.h"

#import "WBWebViewController.h"

@interface MineViewController ()

Strong UIView * BlueView;

Strong UIImageView * picImageView;

Strong UIView * firstView;
Strong UIImageView * firstImageView;
Strong UILabel * firstLabel;
Strong UILabel * contentLabel;

Strong UIView * secondView;
Strong UIImageView * secondImageView;
Strong UILabel * secondLabel;
Strong UIImageView * lookImageView;
Strong UILabel * lookLabel;
Strong UIButton * lookBtn;
Strong UIButton * houseBtn;
Strong UILabel * houseLabel;
Strong UIImageView * houseImageView;


//https://gitee.com/iosbig/polymerized_pocket


@end

@implementation MineViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view addSubview:self.BlueView];
    [self.view addSubview:self.picImageView];
    [self.view addSubview:self.firstView];
    [self.view addSubview:self.secondView];
}

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    
    self.navigationController.navigationBar.hidden = YES;
    
    
}

#pragma Action ---

- (void)lookBtnClick{
    
    WBWebViewController *webVC = [[WBWebViewController alloc] init];
    webVC.urlString = @"https://gitee.com/iosbig/polymerized_pocket";
    webVC.isWKWebView = YES;
    //webVC.title = @"2345";
    
    webVC.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:webVC animated:YES];
    
    
}

- (void)houseBtnClick{
    
    
    
}

#pragma Init----

- (UIView *)BlueView{
    
    if (!_BlueView ) {
        
        _BlueView = [[UIView alloc] init];
        _BlueView.frame = CGRectMake(0, 0, SCREEN_WIDTH, UNIT_HEIGHT(30));
        _BlueView.backgroundColor = getColor(@"1E7CD2");
        
    }
    
    return _BlueView;
    
}

- (UIImageView *)picImageView{
    
    if (!_picImageView) {
        
        _picImageView = [UIImageView addImgWithImage:@"banner_01"];
        
        _picImageView.frame = CGRectMake(UNIT_WIDTH(10), UNIT_HEIGHT(40), SCREEN_WIDTH - UNIT_WIDTH(20), UNIT_HEIGHT(200));
    }
    
    return _picImageView;
}

- (UIView *)firstView{
    
    if (!_firstView) {
        _firstView = [UIView addViewWithFrame:CGRectMake(0, UNIT_HEIGHT(200) + UNIT_HEIGHT(40) + UNIT_HEIGHT(20), SCREEN_WIDTH, UNIT_HEIGHT(150)) WithBackgroundColor:getColor(whiteColor)];
        
        _firstImageView = [UIImageView addImgWithImage:@"kefu"];
        
        _firstLabel = [UILabel addLabelWithFrame:CGRectMake(0, 0, 0, 0) AndText:@"谢谢支持" AndFont:17 AndAlpha:1.0 AndColor:getColor(@"1E7CD2")];
        
        _contentLabel = [UILabel addLabelWithFrame:CGRectMake(0, 0, 0, 0) AndText:@"聚合口袋这个App是我自己练习的一个项目,我整合了一些比较优秀的代码库,还有功能,添加都我的应用之中.写这个小项目的目的就是希望自己多多熟练一些功能,让自己的技能有所提高.也希望有一些功能可以帮助一些刚刚不入门IOS开发的小白." AndFont:13 AndAlpha:1.0 AndColor:getColor(@"111111")];
        _contentLabel.numberOfLines = 0;
        
        [self.firstView sd_addSubviews:@[self.firstImageView,self.firstLabel,self.contentLabel]];
        
        [self.firstImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(UNIT_HEIGHT(10));
            make.left.mas_equalTo(UNIT_WIDTH(10));
            make.height.mas_equalTo(UNIT_HEIGHT(27));
            make.width.mas_equalTo(UNIT_WIDTH(27));
        
        }];
        
        [self.firstLabel mas_makeConstraints:^(MASConstraintMaker *make) {
         
            make.left.mas_equalTo(self.firstImageView.mas_right).offset(UNIT_WIDTH(10));
            make.centerY.mas_equalTo(self.firstImageView.mas_centerY);
            make.height.mas_equalTo(UNIT_HEIGHT(30));
        }];
        
        [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.firstLabel.mas_bottom).offset(UNIT_HEIGHT(10));
            make.left.mas_equalTo(UNIT_WIDTH(10));
            make.right.mas_equalTo(UNIT_HEIGHT(-10));
            //make.bottom.mas_equalTo(UNIT_HEIGHT(-10));
        }];
    }
    
    return _firstView;
    
}

- (UIView *)secondView{
    
    if (!_secondView) {
        
        _secondView = [UIView addViewWithFrame:CGRectMake(0, UNIT_HEIGHT(150) + UNIT_HEIGHT(40) + UNIT_HEIGHT(20) + + UNIT_HEIGHT(210) , SCREEN_WIDTH, UNIT_HEIGHT(150)) WithBackgroundColor:getColor(whiteColor)];
        
        
  
        _secondImageView = [UIImageView addImgWithImage:@"kefu"];
        
        _secondLabel = [UILabel addLabelWithFrame:CGRectMake(0, 0, 0, 0) AndText:@"每天努力一点点" AndFont:17 AndAlpha:1.0 AndColor:getColor(@"1E7CD2")];
        
        
        _lookImageView = [UIImageView addImgWithImage:@"logohong"];
        _lookLabel = [UILabel addLabelWithFrame:CGRectMake(0, 0, 0, 0) AndText:@"查看项目源码" AndFont:15 AndAlpha:1.0 AndColor:getColor(@"111111")];
        _lookBtn = [UIButton addBtnImage:@"" WithTarget:self action:@selector(lookBtnClick)];
        
        
        _houseImageView = [UIImageView addImgWithImage:@"logohong"];
        _houseLabel = [UILabel addLabelWithFrame:CGRectMake(0, 0, 0, 0) AndText:@"查看个人博客" AndFont:15 AndAlpha:1.0 AndColor:getColor(@"111111")];
        _houseBtn = [UIButton addBtnImage:@"" AndFrame:CGRectMake(0, 0, 0, 0) WithTarget:self action:@selector(houseBtnClick)];
        
        [self.secondView sd_addSubviews:@[self.secondImageView,self.secondLabel,self.lookImageView,self.lookLabel,self.lookBtn,self.houseImageView,self.houseLabel,self.houseBtn]];
        
        [self.secondImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(UNIT_HEIGHT(10));
            make.left.mas_equalTo(UNIT_WIDTH(10));
            make.height.mas_equalTo(UNIT_HEIGHT(27));
            make.width.mas_equalTo(UNIT_WIDTH(27));
        }];
        
        [self.secondLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.secondImageView.mas_right).offset(UNIT_WIDTH(10));
            make.centerY.mas_equalTo(self.secondImageView.mas_centerY);
            make.height.mas_equalTo(UNIT_HEIGHT(30));
        }];
        
        [self.lookImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            
            make.top.mas_equalTo(self.secondImageView.mas_bottom).offset(UNIT_HEIGHT(30));
            
            make.left.mas_equalTo(UNIT_WIDTH(10));
            
            make.height.mas_equalTo(UNIT_HEIGHT(27));
            make.width.mas_equalTo(UNIT_WIDTH(27));
            
        }];
        
        [self.lookLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.lookImageView.mas_right).offset(UNIT_WIDTH(10));
            make.centerY.mas_equalTo(self.lookImageView.mas_centerY);
            make.height.mas_equalTo(UNIT_HEIGHT(30));
            make.width.mas_equalTo(UNIT_WIDTH(100));
            
        }];
        
        [self.lookBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(UNIT_WIDTH(10));
            make.top.mas_equalTo(self.lookImageView.mas_top).offset(0);
            make.bottom.mas_equalTo(self.lookImageView.mas_bottom).offset(0);
            make.trailing.mas_equalTo(self.lookLabel.mas_trailing).offset(0);
        }];
        
        
        [self.houseImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            
            make.top.mas_equalTo(self.secondImageView.mas_bottom).offset(UNIT_HEIGHT(30));
            
            make.left.mas_equalTo(self.lookLabel.mas_right).offset(UNIT_WIDTH(30));
            
            make.height.mas_equalTo(UNIT_HEIGHT(27));
            make.width.mas_equalTo(UNIT_WIDTH(27));
            
        }];
        
        [self.houseLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.houseImageView.mas_right).offset(UNIT_WIDTH(10));
            make.centerY.mas_equalTo(self.houseImageView.mas_centerY);
            make.height.mas_equalTo(UNIT_HEIGHT(30));
            make.width.mas_equalTo(UNIT_WIDTH(100));
            
        }];
        
        [self.houseBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            
             make.left.mas_equalTo(self.lookLabel.mas_right).offset(UNIT_WIDTH(30));
            make.top.mas_equalTo(self.houseImageView.mas_top).offset(0);
            make.bottom.mas_equalTo(self.houseLabel.mas_bottom).offset(0);
            make.trailing.mas_equalTo(self.houseLabel.mas_trailing).offset(0);
            
        }];
        
        
        
    }
    
    return _secondView;
    
}

@end
